Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of Object.assign #110

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

jonny-improbable
Copy link
Contributor

The grpc-web service stub code generated by ts-protoc-gen is invoking an ES6 function (Object.assign) which is tricking webpack into treating the modules as ES6 modules instead of ES5 modules.

Replacing the Object.assign invocation with some vanilla ES5 results in webpack correctly identify the module as a CommonJS module and thereby exposing the exports object to the scope of the function.

Fixes #103

The grpc-web service stub code generated by ts-protoc-gen is invoking an ES6 function (`Object.assign`) which is tricking webpack into treating the modules as ES6 modules instead of ES5 modules.

Replacing the `Object.assign` invocation with some vanilla ES5 results in webpack correctly identify the module as a CommonJS module and thereby exposing the `exports` object to the scope of the function.

Fixes #103
@jonny-improbable
Copy link
Contributor Author

@easyCZ could I get a review please? ❤️

Copy link
Contributor

@easyCZ easyCZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jonny-improbable jonny-improbable merged commit 687bcc7 into master Sep 12, 2018
@jonny-improbable jonny-improbable deleted the bugfix/webpack-module-detection branch September 12, 2018 17:13
coltonmorris pushed a commit to coltonmorris/ts-protoc-gen that referenced this pull request Oct 17, 2018
* upstream/master:
  Transport member of ServiceClientOptions should be optional (improbable-eng#125)
  Allow canceling unary calls (improbable-eng#124)
  CI should check that generated code has been committed (improbable-eng#127)
  Bumped to v0.7.8-pre (improbable-eng#123)
  Prepare 0.7.7 release (improbable-eng#112)
  Clean up Bazel Installation during Travis Build (improbable-eng#122)
  Don't deploy .deb files to npm (improbable-eng#121)
  Fix snake_cased oneof message are generated to incorrect types (improbable-eng#118)
  Make ServiceError optionally null (improbable-eng#116)
  Be explicit about the need for a CommonJS environment. (improbable-eng#108)
  Replace usage of `Object.assign` (improbable-eng#110)
  Add hint for Windows users (improbable-eng#107)
  Collapse Bazel Instructions in README (improbable-eng#106)
  Implement Client Streaming and BiDi Streaming for grpc-web (improbable-eng#82)
  Add support for jstype annotation (improbable-eng#104)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants